package com.x.Part4_抽象类.练习;

/**
 * ClassName: HourlyEmployee
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.03.04 22:06
 */
public class HourlyEmployee extends Employee{

    private int wage;//时薪
    private double hours;

    public HourlyEmployee() {
    }

    public HourlyEmployee(MyDate birthday, String name, int number, int wage, double hours) {
        super(birthday, name, number);
        this.wage = wage;
        this.hours = hours;
    }

    public double getWage() {
        return wage;
    }

    public void setWage(int wage) {
        this.wage = wage;
    }

    public double getHours() {
        return hours;
    }

    public void setHours(double hours) {
        this.hours = hours;
    }

    @Override
    public double earnings() {
        return wage * (int) hours;
    }

    @Override
    public String toString() {
        return "HourlyEmployee{" + super.toString()+ '}';
    }
}
